﻿using Sai.Core;
using Sai.Core.Introspection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Sai.Test.TestDataBuilders
{
    public class SimpleAssemblyDifferenceBuilder
    {
        private AssemblyDifference _difference = new AssemblyDifference();

        public static SimpleAssemblyDifferenceBuilder Differences()
        {
            return new SimpleAssemblyDifferenceBuilder();
        }

        public SimpleAssemblyDifferenceBuilder Named(string name)
        {
            this._difference.Name = name;

            return this;
        }

        public SimpleAssemblyDifferenceBuilder FromVersion(string v1)
        {
            this._difference.FromVersion = v1;

            return this;
        }

        public SimpleAssemblyDifferenceBuilder ToVersion(string v2)
        {
            this._difference.ToVersion = v2;

            return this;
        }

        public SimpleAssemblyDifferenceBuilder Add(TypeName tn)
        {
            this._difference.Added(tn);

            return this;
        }

        public SimpleAssemblyDifferenceBuilder Change(ITypeDifference diff)
        {
            this._difference.Changed(diff);

            return this;
        }

        public SimpleAssemblyDifferenceBuilder Remove(TypeName tn)
        {
            this._difference.Removed(tn);

            return this;
        }

        public SimpleAssemblyDifferenceBuilder Obsolete(TypeName tn)
        {
            this._difference.Obsolete(tn, string.Empty);

            return this;
        }

        public AssemblyDifference Build()
        {
            return this._difference;
        }
    }
}
